﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using DatabaseAccessLayer;
using SavoryBL;

namespace WebApplication.administrator
{
    public partial class Change_Password : System.Web.UI.Page
    {
        SavoryAdminAccount adminAccountObj = new SavoryAdminAccount();
        protected void btn_Update_Click(object sender, EventArgs e)
        {
            try
            {
                if (Session["Admin"] != null && Session["Admin"].ToString() != "")
                {
                    
                    ResponseStatus status = ResponseStatus.Failure;
                    status = adminAccountObj.AdminChangePassword(Convert.ToInt32(Session["AdminID"].ToString()), Session["Admin"].ToString(), txt_OldPassword.Text.Trim(), txt_NewPassword.Text.Trim());
                    if (status == ResponseStatus.Success)
                    {
                        div_UpdatePwdMsg.Style["display"] = "block";
                    }
                }
            }
            catch (Exception ex)
            {
                throw;
            }
        }
    }
}